import React, { Component } from 'react';
//引入组件
import Rights from "@/pages/components/rights/right"
import Lefts from "@/pages/components/lefts/lefts"
import Layers from "@/pages/layers/layers"
//引入mobx文件数据
import store from "@/store/store"
//导入mobx的注入方法
import { Provider } from 'mobx-react'
//导入初始化的scss样式
import "@/scss/reset.scss"
import Styles from "@/scss/index.scss"




export default () => {
  return (
    <Index />
  )
}

//定义入口组件
class Index extends Component<any, any>{
  componentDidMount() {
    store.initTodos() //初始化todos,即读取本地待办事件数据
   
  }

  render() {
    return (
      <div className={Styles.All_box}>
        <div className={Styles._box}>
          {/* 注入store数据数据*/}
          <Provider >
            <Layers store={store} />{/* 蒙层组件 此处必须传入store,第一层不传入无法监听 */}
            <Lefts store={store} />{/* 左边部分组件 */}
            <Rights store={store} />{/* 右边部分组件 */}
          </Provider>
        </div>
      </div>
    )
  }
}
